package cn.edu.buaa.neo.query.cxx.misuse.outdateProblem;

import cn.edu.buaa.neo.codegraphql.dsl.lib.engine.QueryEngine;
import cn.edu.buaa.neo.codegraphql.dsl.fluent.query.QueryDescriptor;
import cn.edu.buaa.neo.codegraphql.language.cxx.CxxQuery;
import cn.edu.buaa.neo.codegraphql.language.shared.predicate.ContainsFunctionCall;

import java.io.PrintStream;

public class FunctionOutdated extends CxxQuery {
    public static void main(String[] args) {
        QueryEngine.getInstance()
                .execute(FunctionOutdated.class.getSimpleName(), new FunctionOutdated())
                .close();
    }

    @Override
    public void run(String style, PrintStream output) {
        QueryDescriptor.open()
                .from("source", new ContainsFunctionCall("gets")
                        .or(new ContainsFunctionCall("gmtime"))
                        .or(new ContainsFunctionCall("sprintf"))
                        .or(new ContainsFunctionCall("strcpy")))
                .select("source")
                .display();
    }
}
